package com.da.javatest.leetCode;

import java.util.Arrays;

/**
 * @author chenlida
 * @date 2019/1/17 09:33
 * @description
 */
public class Code268 {
    public int missingNumber(int[] nums) {
        int t = 0;
        int sum = 0;
        for (int i = 0; i < nums.length; i++) {
            t = t + i;
            sum += nums[i];
        }
        return t + nums.length - sum;
    }
}
